<template>
  <div class="app">
    <router-view class="main" />
    <van-tabbar
      class="bar"
      route
      v-model="active"
      active-color="deeppink"
      v-show="isShow"
    >
      <van-tabbar-item :to="{ name: 'Home' }" icon="search"
        >发现</van-tabbar-item
      >
      <van-tabbar-item :to="{ name: 'Tour' }" icon="like-o"
        >旅行</van-tabbar-item
      >
      <van-tabbar-item :to="{ name: 'User' }" icon="friends-o"
        >我的</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>
<script>
export default {
  name: "App",
  data() {
    return {
      active: 0,
      isShow: true,
    };
  },
  watch: {
    $route(v) {
      const hideNav = ["Detail", "Login"];
      if (hideNav.indexOf(v.name) > -1) {
        this.isShow = false;
      } else {
        this.isShow = true;
      }
    },
  },
};
</script>
<style scoped>
.bar {
  box-shadow: 0px 1px 2px gray;
  color: rgb(100, 128, 0);
  position: none;
}
</style>
